<!-- Breadcrums -->
<?php $this->load->view('helpers/breadcrums.php'); ?>
<!-- Breadcrum -->
<div class="container">
	<div id="main">
		<div class="row">
			<div class="span9">
				<div class="w-box">
					<div class="w-box-content cnt_a">
						<div class="row-fluid node-findanexpert">
							<div class="image span3">
								<div class="content">
									<div class="title">
										<h2><a href="javascript:void();"><?php echo $findanexpert_info['BusinessName']; ?></a></h2>
									</div>
									<div class="image">
										<img src="<?php echo base_url(); ?>findanexpert/getAgentProfilePhoto/<?php echo $findanexpert_info['User_ID'];?>" alt="<?php echo $findanexpert_info['BusinessName']; ?>">
									</div>
								</div>
								<!-- /.content -->
							</div>
							<div class="span9">
								<div class="row-fluid"></div>
								<div class="row-fluid">
									<div class="info page-content">
										<div class="span8">
											<p class="sepH_a"><?php echo sprintf($text_cea_reg_num, $findanexpert_info['CEA_LicenceNo']); ?></p>
											<p class="sepH_a mobile"><?php echo $Mobile; ?></p>
											<p class="sepH_a"><?php echo $findanexpert_info['Email']; ?></p>
											<?php if($findanexpert_info['LicenceNo'] == "L3010359I") { ?>
											<p class="sepH_a"><?php echo $text_company_agent; ?></p>
											<?php } else { ?>
											<p class="sepH_a"><?php echo sprintf($text_broker_with, ''); ?></p>
											<?php } ?>
											<p class="sepH_a"><?php echo sprintf($text_cea_com_num, $findanexpert_info['LicenceNo']); ?></p>
										</div>
										<div class="span4">
											<div class="pull-right">
												<button class="btn btn-primary find_an_expert_btn" data-toggle="modal" data-target="#myModal">Contact Me</button>
											</div>
										</div>
										<div class="clearfix"></div>
									</div>
									<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
										<div class="modal-header">
										  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
										  <input type="hidden" name="agent_email" value="<?php echo $findanexpert_info['Email']; ?>" >
										  <h3 id="myModalLabel"><?php echo $text_contact_this_agent; ?></h3>
										</div>
										<div class="modal-body">
											<div class="content">
										  		<div class="row-fluid">
										  			<div class="image span4">
										  				<img src="<?php echo base_url(); ?>findanexpert/getAgentProfilePhoto/<?php echo $findanexpert_info['User_ID'];?>" alt="<?php echo $findanexpert_info['BusinessName']; ?>">
										  			</div>
										  			<div class="body span8">
										  				<h3><?php echo $findanexpert_info['BusinessName']; ?></h3>
										  				<p><?php echo sprintf($text_cea_reg_num, $findanexpert_info['CEA_LicenceNo']); ?></p>
										  				<p><a><?php echo $Mobile; ?></a></p>
										  				<?php if($findanexpert_info['LicenceNo'] == "L3010359I") { ?>
														<p><?php echo $text_company_agent; ?></p>
														<?php } else { ?>
														<p><?php echo sprintf($text_broker_with, ''); ?></p>
														<?php } ?>
														<p><?php echo sprintf($text_cea_com_num, $findanexpert_info['LicenceNo']); ?></p>
										  			</div>
										  		</div>
									  			<div class="row-fluid">
									  				<div class="span4">
									  					<input type="text" name="agent_name" id="agent_name" class="span12 agent_name" maxlength="20" value="Name">
									  				</div>
									  				<div class="span4">
									  					<input type="text" name="agent_phone" id="agent_phone" class="span12 agent_phone" maxlength="20" value="Phone">
									  				</div>
									  				<div class="span4">
									  					<input type="text" name="agent_email" id="agent_email" class="span12 agent_email" maxlength="20" value="Email">
									  				</div>
									  			</div>
									  			<div class="row-fluid">
									  				<textarea class="span12" name="agent_message" id="agent_message" cols="70" rows="3">Hello <?php echo $findanexpert_info['BusinessName']; ?>, I saw your listing on the Singapore website and am interested to find out more. Please contact me via email to schedule a meeting. Thank you.</textarea>
									  			</div>
											</div>
										</div>
										<div class="modal-footer">
										  <button class="btn btn-primary">Send</button>
										</div>
									</div>
								</div>
								<?php if(isset($findanexpert_info['About'])) { ?>
								<div class="row-fluid">
									<div class="info">
										<h2 class="page-header">About</h2>
										<?php echo $findanexpert_info['About'] ?>
									</div>
								</div>
								<?php } ?>
								<div class="row-fluid">
									<div class="info">
										<h2 class="page-header">Experience & Skills</h2>
										<?php if(isset($findanexpert_info['AgentType']) && !empty($findanexpert_info['AgentType'])) { ?>
										<p class="formSep">
											<strong>Client Type:</strong> <?php echo $findanexpert_info['AgentType']; ?>
										</p>
										<?php } ?>
										<?php if(isset($strPropertyType) && !empty($strPropertyType)) { ?>
										<p class="formSep">
											<strong>Property Type:</strong>
											<?php echo $strPropertyType; ?>
										</p>
										<?php } ?>
										<?php if(isset($strSpeciality) && !empty($strSpeciality)) { ?>
										<p class="formSep">
											<strong>Specialty: </strong>
											<?php echo $strSpeciality; ?>
										</p>
										<?php } ?>
										<?php if(isset($strLanguage) && !empty($strLanguage)) { ?>
										<p class="formSep">
											<strong>Languages: </strong>
											<?php echo $strLanguage; ?>
										</p>
										<?php } ?>
									</div>
								</div>
								<?php if(is_array($agentListingMedia) && count($agentListingMedia) > 0) { ?>
								<div class="row-fluid">
									<div class="info">
										<h2 class="page-header">Listings</h2>
										<div class="tabbable tabbable-bordered property-detail-listing">
											<ul class="nav nav-tabs">
												<li class="active"><a data-toggle="tab" href="#tb1_a">For Sale</a></li>
											</ul>
											<div class="tab-content">
												<div id="tb1_a" class="tab-pane active">
													<div class="carousel">
													    <div class="content" style="border: 0px none;">
													        <a class="carousel-prev">Previous</a>
													        <a class="carousel-next">Next</a>
													        <ul>
													        	<?php foreach ($agentListingMedia as $media) { ?>
													            <li>
													            	<div class="title">
													                    <h3><?php echo $media['price']; ?></h3>
													                </div><!-- /.title -->
													                <div class="image">
													                    <a href="<?php echo base_url(); ?>detail/<?php echo $media['Link'] ?>"></a>
													                    <img src="<?php echo $media['thumb']; ?>" alt="">
													                </div><!-- /.image -->
													            </li>
													            <?php } ?>
													        </ul>
													    </div><!-- /.content -->
													</div><!-- /.carousel -->
												</div>
											</div>
										</div>
									</div>
								</div><!-- /.row-fluid -->
								<?php } ?>
								<div class="row-fluid">
									<div class="info">
										<?php if($total_recommendations > 0) { ?>
										<div class="pull-left">
											<h2 class="page-header">Recommendations <?php echo "(" . $total_recommendations . ")";?></h2>
										</div>
										<?php } ?>
										<div class="pull-right">
											<!--  <button class="btn btn-primary" data-toggle="modal" data-target="#myRecommendations">Recommend me</button>-->
										</div>
										<div id="myRecommendations" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
											<div class="modal-header">
											  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
											  <h3 id="myModalLabel">Contact this Agent</h3>
											</div>
											<div class="modal-body">
												<div class="content">
											  		<div class="row-fluid">
											  			<div class="image span4">
											  				<?php  
															$isPhoto = $this->mdl_findanexpert->isAgentPhoto($findanexpert_info['User_ID']);
															?>
															<?php if($isPhoto) { ?>
															<img src="<?php echo base_url(); ?>findanexpert/getAgentProfilePhoto/<?php echo $findanexpert_info['User_ID'];?>">
															<?php } else { ?>
															<img src="<?php echo $this->config->item('HTTP_AGENTS_MEDIA_IMAGE'); ?>no-image.jpg" />
															<?php } ?>
											  			</div>
											  			<div class="body span8">
											  				<h3><?php echo $findanexpert_info['BusinessName']; ?></h3>
											  				<h5><a><?php echo $Mobile; ?></a></h5>
											  			</div>
											  		</div>
										  			<div class="row-fluid">
										  				<div class="span4">
										  					<input type="text" name="agent_name" id="agent_name" class="span12" maxlength="20" placeholder="Name">
										  				</div>
										  				<div class="span4">
										  					<input type="text" name="agent_name" id="agent_name" class="span12" maxlength="20" placeholder="Phone">
										  				</div>
										  				<div class="span4">
										  					<input type="text" name="agent_name" id="agent_name" class="span12" maxlength="20" placeholder="Email">
										  				</div>
										  			</div>
										  			<div class="row-fluid">
										  				<textarea class="span12" name="agent_message" id="agent_message" cols="70" rows="3"><?php echo $findanexpert_info['BusinessName']; ?>, I saw your profile on Indonesia Residential. I'd like to schedule time for us to talk. Please reply to this email if you are interested.</textarea>
										  			</div>
												</div>
											</div>
											<div class="modal-footer">
											  <button class="btn btn-primary">Send</button>
											</div>
										</div>
										<div class="clearfix"></div>
										<?php if(is_array($content_recommendations) && count($content_recommendations) > 0) { ?>
										<?php foreach ($content_recommendations as $content) { ?>
										<div class="row-fluid">
											<div class="span2">
												<div class="img-holder">
													<img class="img-avatar" alt="" src="<?php echo base_url(); ?>assets/img/icons/avatar.png">
												</div>
											</div>
											<div class="span10">
												<p class="formSep"><small class="muted">Name:</small> <?php echo $content->UserName; ?></p>
												<p class="formSep"><small class="muted">Content:</small> <?php echo $content->Content; ?></p>
												<p class="formSep"><small class="muted"><?php echo date('d-M-Y',strtotime($content->CreatedDate));?></small></p>			
											</div>
										</div>
										<?php } ?>
										<?php } ?>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="sidebar span3"><?php $this->load->view('helpers/widgets/ad.php'); ?>
			</div>
		</div>
	</div>
</div>
